<% include ../head %>
<div class="mainpage">
<%
    var texts = {Training: {header: "Neo4j Training", text: "Become proficient with Neo4j by attending a training class close to you.  If you enjoy focused, hands-on learning with a Neo4j expert, our training classes are your best option.<br/>\
    Don't see a class you want?  in a location you need?  Email us at <a href='mailto:training@neotechnology.com'>training@neotechnology.com</a>"}
                };
%>

    <h1><%- (texts[requestedType]||{})['header'] || "Neo4j Events" %></h1>
    <div class="introText">

    <p><%- (texts[requestedType]||{})['text'] || "\
        Join the Neo4j community at one of our events! Learn about Neo4j at a conference, meet other Neo4j users at a meet up, or quickly get up to speed at a Neo4j training near you. <br/>\
        If you want to learn more about Neo4j nothing beats a hands on experience. Listen to our community members and driver authors,\
    talk to our engineers or discuss with our customers. There are many Neo4j Meetups, Training Classes and Conferences happening everywhere and\
    at any time.\
        " %>
    </p>
    </div>
    <!--<h3>Events for your region: -->
		<!--<select id="region" style="width:10em;height:1.8em;vertical-align:baseline;">-->
		   <!--<option value="WORLD">All</option>-->
		   <!--<option value="US">North America</option>-->
		   <!--<option value="EU">Europe</option>-->
		   <!--<option value="DE">Germany, Austria, Switzerland</option>-->
		<!--</select>-->
    <!--</h3>-->
        <%
            var _events = events; // (requestedSource == "calendar") ? events : events2;

			var groupedEvents = {Conference:[],Meetup:[],Webinar:[],Training:[]};
			for (var i=0;i<_events.length;i++) {
			    var event=_events[i];
			    if (!event) continue;
			    var type=event.Type;
			    if (!groupedEvents[type]) { type="Conference"; event.Type=type;}
				groupedEvents[type].push(event);
			}
	        %>
			<% 	for (type in groupedEvents) {
                if (requestedType && requestedType != type) continue;
            %>
            <br/>
			    <% if (!requestedType) { %>
                <h2><%= type %></h2>
                <% } %>
                <table class="events">
                    <tr>
                        <th class="event_title"    style="width:40%"><%= type == "Training" ? "Course":""%> Title</th>
                        <th class="event_location" style="width:40%">Location</th>
                        <th class="event_date"     style="width:15%">Date</th>
                        <th class="event_presenter" >Presenter</th>
                        <th class="event_register" style="width:5%">Register</th>
                    </tr>
                    <% groupedEvents[type].forEach(function(event) { %>
                    <% include event_table %>
                    <% }); %>
                </table>
			<% } %>
</div>

<script type="text/javascript">
$(document).ready(function() {
    var region="<%= region %>";
	
	function filterByRegion(region) {
    	$(".event").each(function() {
    		var area = $(this).attr("area");
    		if (!area || area=='WORLD' || region=='WORLD' || area==region) $(this).show();
    		else $(this).hide();
    	})
//        nav.resize();
    }
	$("#region").val(region).change(function() {
	    filterByRegion($(this).val());
	})
	filterByRegion(region);
	
/*
    $('div.meetup').each(function() {
        var e=$(this);
        $.get("/api/meetup?group="+e.attr("group")+"&event="+e.attr("event"), function(data,err) {
            e.html(data);
        })
    })
*/
})
</script>
    <% include ../foot %>

